#!/usr/bin/python3
#-*- coding: utf-8 -*-
# @Time    : 2019/2/1 10:27 PM
# @Author  : way
# @Email   : wuaoyi@gmail.com
# @File    : js.py
# @Software: PyCharm

#抓取这个网站的内容：http://www.sse.com.cn
import requests,re

number = []

with open("上海交易所.txt",'r+',encoding="utf-8") as fw:
    for i in fw.readlines():
        number.append(i)
arr = []
static_url = 'http://static.sse.com.cn'


while True:

    for i in number:
        url = 'http://www.sse.com.cn/js/common/stocks/new/'+i.strip()+'.js?_=1549031175644'

        wbdata = requests.get(url).text

        news = re.findall(r'bulletin_title:"(.*?)"',wbdata)
        print(news)

        urls = re.findall(r'bulletin_file_url:"(.*?)"',wbdata)

        for i in urls:
            arr.append(static_url+i)

        print(arr)

        break



